package com.bkgy.modular.tpdodata_cal1630.converter;

import com.bkgy.modular.tpdodata_cal1630.entity.TPdoDataCal1630;
import com.bkgy.modular.tpdodata_cal1630.entity.TPdoDataCall1630_bao;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

/**
 * 1630连退生产计划表宝信实体转换器
 * 实现TPdoDataCall1630_bao到TPdoDataCal1630的字段映射
 */
@Mapper(unmappedTargetPolicy = org.mapstruct.ReportingPolicy.IGNORE,
        unmappedSourcePolicy = org.mapstruct.ReportingPolicy.IGNORE,
        builder = @org.mapstruct.Builder(disableBuilder = true),
        nullValuePropertyMappingStrategy = org.mapstruct.NullValuePropertyMappingStrategy.IGNORE,
        nullValueCheckStrategy = org.mapstruct.NullValueCheckStrategy.ALWAYS,
        componentModel = "default",
        injectionStrategy = org.mapstruct.InjectionStrategy.CONSTRUCTOR)
public interface TPdoDataCal1630Converter {

    TPdoDataCal1630Converter INSTANCE = Mappers.getMapper(TPdoDataCal1630Converter.class);

    @Mapping(source = "extid", target = "extid") //连退出口卷号，直接映射
    @Mapping(source = "entid", target = "entid") //连退入口卷号，直接映射
    @Mapping(source = "ext_thich", target = "outMatThk") //出口厚度，从宝信系统厚度字段映射
    @Mapping(source = "ext_weight", target = "outMatWt") //出口重量，从宝信系统重量字段映射
    @Mapping(source = "ext_length", target = "outMatLen") //出口长度，从宝信系统长度字段映射
    @Mapping(source = "ext_diaminner", target = "outMatInnerDia") //出口内径，从宝信系统内径字段映射
    @Mapping(source = "ext_diamout", target = "outMatOuterDia") //出口外径，从宝信系统外径字段映射
    @Mapping(source = "ext_width", target = "outMatWidth") //出口宽度，从宝信系统宽度字段映射
    @Mapping(source = "shift", target = "shift") //班次，直接映射
    @Mapping(source = "crew", target = "crew") //班组，直接映射
    @Mapping(source = "steelgrade", target = "steelgrade") //钢种，直接映射
    @Mapping(source = "c_spmcustcode", target = "spmMode") //平整方式代码，直接映射
    @Mapping(source = "c_memo1", target = "prodStartTime") //开始生产时间，从宝信系统备注字段映射
    @Mapping(target = "enthkClass", source = "enthk_class") //入口厚度分档代码，直接映射
    @Mapping(target = "exthkClass", source = "exthk_class") //出口厚度分档代码，直接映射
    @Mapping(target = "enwidthClass", source = "enwidth_class") //入口宽度分档代码，直接映射
    @Mapping(target = "exwidthClass", source = "exwidth_class") //出口宽度分档代码，直接映射
    @Mapping(target = "ypClass", source = "yp_class") //钢种分档代码，直接映射
    @Mapping(target = "createTime", expression = "java(new java.util.Date())") //创建时间，使用当前时间
    @Mapping(target = "indocno", ignore = true) //文档编号，宝信系统中无对应字段
    TPdoDataCal1630 toTPdoDataCal1630(TPdoDataCall1630_bao bao);
}